home *** CD-ROM | disk | FTP | other *** search
- Path: shrike.depaul.edu!usenet
- From: Kazuki Murakami <kmurakam@shrike.depaul.edu>
- Newsgroups: comp.lang.c
- Subject: question on pass-by-reference
- Date: 16 Jan 1996 22:50:59 GMT
- Organization: DePaul University
- Message-ID: <4dha4j$4qg@shrike.depaul.edu>
- NNTP-Posting-Host: dept11.ac-sia.depaul.edu
-
-
- I have a question on pass-by-reference.
- Here is a problem, I want to set array of unsigned short number to be all 0 using a function.
- here is what set looks like:
- typedef unsigned short USHORT;
- typedef USHORT SET[32];
-
- here is the setInit, which will initialize set to be 0,
- void setInit (SET *s)
- {
- int i;
-
- for (i=0; i<32; i++)
- {
- *s[i] = 0;
- }
- }
-
- here is the calling function.
- setInit(&set1); setInit(&set2);
-
- I think there is somthing wrong in "setInit" function but I cannot seem to figure out what that is.
- If somebody can figure out what that is or some other way of initializing "SET s" please give
- me a e-mail.
- e-mail address is kmurakam@shrike.edpaul.edu
-
- Thank you
-
- Kazuki Murakami
-